﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Linq;
using NDepot.Models;

namespace NDepot.Repository
{
    public class DepotDataContext : DataContext
    {
        private const string CONNECT_STRING = 
            @"Data Source=localhost\sqlexpress;Initial Catalog=Depot;Persist Security Info=True;User ID=sa;Password=12345678";

        public DepotDataContext()
            : this(CONNECT_STRING)
        {
        }

        public DepotDataContext(string connection)
            : base(connection)
        {
            this.Log = Console.Out;
            this.DeferredLoadingEnabled = false;
        }

        public Table<Product> Products;
        public Table<Order> Orders;
        public Table<LineItem> LineItems;
    }
}